package com.bbs.core;

import java.util.HashMap;
import java.util.Map;

import javax.sql.DataSource;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.Banner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;
import org.springframework.core.env.Environment;
import org.springframework.core.io.DefaultResourceLoader;
import org.springframework.core.io.support.ResourcePatternResolver;
import org.springframework.core.io.support.ResourcePatternUtils;

import com.alibaba.druid.pool.DruidDataSource;

@SpringBootApplication
@EnableCaching
@MapperScan("com.bbs.core.dao")//将项目中对应的mapper类的路径加进来就可以了
public class JforumApplication extends SpringBootServletInitializer{

	@Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(JforumApplication.class);
    }
	
	public static void main(String[] args) throws Exception {
        SpringApplication app = new SpringApplication(JforumApplication.class);
        //关闭打印输出spring图标
        app.setBannerMode(Banner.Mode.OFF);
//        PageQuery.DEFAULT_PAGE_SIZE =10 ;
        app.run(args);

    }

    /*@Bean(name = "luceneUtil")
    public LuceneUtil luceneUtil(Environment env){
    	LuceneUtil luceneUtil = new LuceneUtil();
    	luceneUtil.setIndexDer(env.getProperty("lucene.indexder"));
    	return luceneUtil;
    }*/
    
}
